package websocket.dto;

/**
 * 返回值枚举
 *
 * @author 86133
 * @version v1.0
 * @since 2019/7/28 11:31
 */
public enum ResultEnum {
    /**
     * 成功
     */
    success(0, "success"),
    METHOD_NOT_SUPPORTED(517, "请求方法不存在"),
    SYSTEM_ERROR(500, "服务异常"),
    PARAM_ERROR(503, "参数错误"),
    PARAM_TYPE_ERROR(603, "参数类型错误"),
    DATE_NOT_FIND(511, "数据不存在"),
    DATE_IS_FIND(515, "数据已存在"),
    /**
     * 空文件，参数错误
     */
    FILE_NOT_UPLOADED_PARAMS_ERROR(503, "文件不存在，参数错误"),
    /**
     * 不允许上传的文件格式，请上传gif,jpg,bmp格式文件
     */
    FILE_FORMAT_NOT_ALLOWED_TO_UPLOAD(503, "不允许上传的文件格式，请上传gif,jpg,png,jpeg格式文件"),
    /**
     * throw new ResourceNotFoundException("上传失败,请勿上传CMKY图片,请将图片模式修改为RGB！");
     */
    FILE_UPLOAD_ERROR(503, "不允许上传的文件格式，请上传gif,jpg,png,jpeg格式文件"),
    FAIL_SERIAL(503, "通讯失败!"),
    ERROR_SERIAL(531, "端口指向设备不是串口类型!"),
    NOT_FIND_SERIAL(531, "没有找到与该端口名匹配的串口设备!"),
    NOT_FIND_CHUAN_KOU_DATA(503, "未读取到串口信息！"),
    PLEASE_CONTENT(503, "请先通讯"),
    ERROR_CONFIG(531, "错误的配置!");

    private final int code;

    private final String message;

    private ResultEnum(int code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
